package com.foreknow.demo3;

import sun.security.util.Length;

import java.util.Scanner;

public class ArrayDemo1 {
    public static void main(String[] args) {
        int[] myList = {1, 2, 3, 3};
/*        double maxNum = myList[0];
        for (int i = 0;i<myList.length;i++){
            System.out.println(myList[i]);
            sum+=myList[i];
            if (myList[i] > maxNum){
                maxNum = myList[i];
            }
        }
        System.out.println(sum);
        System.out.println(maxNum);*/
/*        String[] str = new String[5];
        str[0] = "A";
        str[1] = "B";
        str[2] = "C";
        str[3] = "D";
        str[4] = "E";*/


/*        Scanner input = new Scanner(System.in);
        String str = input.nextLine();
        String[] strArr = str.split(",");
        int[] score = new int[strArr.length];//修改一下固定次数
        for (int i = 0;i<score.length;i++){
            score[i] = Integer.parseInt(strArr[i]);
        }
        printArray(score);*/
//        int[] arrList = {1,23,45,67,89};
//        int sum = 0;
//        for (int i = 0;i<arrList.length;i++){
//            sum+=arrList[i];
//        }
//        System.out.println(sum/arrList.length);


        int[] arrayList2 = {23,15,22,14,15,16};
        int minNum = arrayList2[0];
        for (int i = 0;i<arrayList2.length;i++){
            if (arrayList2[i] < minNum){
                minNum = arrayList2[i];
            }
        }
        System.out.println(minNum);


    }
    public static void printArray(int[] array) {
        for (int i = 0;i<array.length;i++){
            System.out.print(array[i] + " ");
        }
    }



}
